import React from 'react';
import * as icons from '@ant-design/icons';

const Icon = (props: { icon: string | any }) => {
  const { icon } = props;
  const antIcon: { [key: string]: any } = icons;
  const AntIcon = React.createElement(antIcon[icon]);
  return AntIcon;
};

export default Icon;